function correctRadialDistortionSequence(filename, k, type)

tmp = sprintf('_radialDistCorr%7.7f.avi',k);
movObj = mmreader(filename);
aviObj = avifile([filename tmp],'fps',movObj.FrameRate,'compression','None');

if(nargin<3)
    %findRadialCorrectionParam(,,)
end

if(strcmp(type,'L1'))
    nFrames = movObj.NumberOfFrames;
    if(nFrames>2000)        %Matlab is limited with 2GB for avifile command
        nFrames=2000;
    end
    for i=1:nFrames
        img1 = read(movObj,i);			 %m*n*3
        img2 = radialCorrection(img1,k,type);
        aviObj = addframe(aviObj,img2);
    end
end

aviObj = close(aviObj);

end

